package parser;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import common.StrutsStaticParams;

public class DefaultValue 
{
	public Map<String, String> getParams() throws FileNotFoundException, IOException
	{
		Map<String, String> map = new HashMap<String, String>();
		
		String filePath = this.getClass().getResource("/").getPath().substring(1) + StrutsStaticParams.DEFAULT_VALUE_FILE;
		Properties prop = new Properties();
		prop.load(new FileInputStream(new File(filePath)));
		
		Enumeration e = prop.keys();
		while(e.hasMoreElements())
		{
			String key = e.nextElement().toString();
			map.put(key, prop.getProperty(key));
		}
		
		return map;
	}
}
